package com.labreeze.spring.ioc;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class TestLifeCycle implements BeanFactoryAware,BeanNameAware,InitializingBean,DisposableBean{
    private String brand;
    private String color;
	private String beanName;
	private BeanFactory beanFactory;
	
	public  TestLifeCycle(){
		System.out.println("TestLifeCycle构造函数.........");
	}
	
	public void destroy() throws Exception {
		// TODO Auto-generated method stub
		System.out.println("destroy.............");
		
	}

	public void afterPropertiesSet() throws Exception {
		// TODO Auto-generated method stub
		System.out.println("afterPropertiesSet..............");
	}

	public void setBeanName(String name) {
		// TODO Auto-generated method stub
		this.beanName=name;
		System.out.println("setBeanName................");
	}

	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		// TODO Auto-generated method stub
		this.beanFactory=beanFactory;
		System.out.println("setBeanFactory.............");
	}
	
	
	public void myinit(){
		System.out.println("myinit.................");
	}
	
	
	public void myDestroy(){
		System.out.println("myDestroy...........");
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		System.out.println("setBrand................");
		this.brand = brand;
	}
	
	
	
	
	

}
